<script type="text/javascript">
    //清空值
    function val_del(itemid,itemname) {
        $('#'+itemid).val('');
        $('#'+itemname).val('');
    }
    <#-- HFDataExchange -->
    //选择员工
    function selectUser(id, name, title, width, height){
        var size = new DefaultfSize(width, height);
        var dialog_id = Math.floor(Math.random()*1000000);
        title = getDefaultfTitle(title, '选择员工');
        openDialog(dialog_id, title, '/HFDataExchange/view/user/userselect.do', {ids:$('#' + id).val()}, size.width, size.height, function(){
            var returnVal = this.returnValue;
            if (returnVal) {
                $('#' + id).val(returnVal.codes);
                $('#' + name).val(returnVal.names);
            }
            return false;
        });
    }

    //选择科室
    function selectDept(id, name, title, width, height){
        var size = new DefaultfSize(width, height);
        var dialog_id = Math.floor(Math.random()*1000000);

        openDialog(dialog_id, title, '/HFDataExchange/view/dept/singleselect.do', '', size.width, size.height, function(){
            var returnVal = this.returnValue;
            if (returnVal) {
                $('#' + id).val(returnVal.nodeId);
                $('#' + name).val(returnVal.nodeName);
            }
            return false;
        });
    }

    //获取默认标题
    function getDefaultfTitle(title, default_title) {
        if(title == null || title == undefined || title == '')
            return default_title;
        else
            return title;
    }
    //获取默认窗口大小
    function DefaultfSize(width, height) {
        if(width == undefined)
            this.width = 1000;
        else
            this.width = width;
        if(height == undefined)
            this.height = 450;
        else
            this.height = height;
    }
</script>



